/////////////////////////////////////////////////////////////////////////////
// Name:        dgt_StudioApp.cpp
// Purpose:     
// Author:      Aleksey Plotnikov & Alla Nabatova
// Modified by: 
// Created:     07/03/2008 08:59:55
// RCS-ID:      
// Copyright:   Diamant Software
// Licence:     
/////////////////////////////////////////////////////////////////////////////

#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
#pragma implementation "dgt_StudioApp.h"
#endif

// For compilers that support precompilation, includes "wx/wx.h".
#include "wx/wxprec.h"

#ifdef __BORLANDC__
#pragma hdrstop
#endif

#ifndef WX_PRECOMP
#include "wx/wx.h"
#endif

////@begin includes
////@end includes

#include "dgt_StudioApp.h"
#include "dgt_MainFrame.h"

////@begin XPM images

////@end XPM images

/*!
 * Application instance implementation
 */

////@begin implement app
IMPLEMENT_APP( dgt_StudioApp )
////@end implement app

/*!
 * dgt_StudioApp type definition
 */

IMPLEMENT_CLASS( dgt_StudioApp, wxApp )

/*!
 * dgt_StudioApp event table definition
 */

BEGIN_EVENT_TABLE( dgt_StudioApp, wxApp )

////@begin dgt_StudioApp event table entries
////@end dgt_StudioApp event table entries

END_EVENT_TABLE()

/*!
 * Constructor for dgt_StudioApp
 */

dgt_StudioApp::dgt_StudioApp()
{
	m_pManager = NULL;
////@begin dgt_StudioApp member initialisation
////@end dgt_StudioApp member initialisation
}

/*!
 * Initialisation for dgt_StudioApp
 */

bool dgt_StudioApp::OnInit()
{    
////@begin dgt_StudioApp initialisation
    // Remove the comment markers above and below this block
    // to make permanent changes to the code.

#if wxUSE_XPM
    wxImage::AddHandler(new wxXPMHandler);
#endif
#if wxUSE_LIBPNG
    wxImage::AddHandler(new wxPNGHandler);
#endif
#if wxUSE_LIBJPEG
    wxImage::AddHandler(new wxJPEGHandler);
#endif
#if wxUSE_GIF
    wxImage::AddHandler(new wxGIFHandler);
#endif
////@end dgt_StudioApp initialisation

	// init plugin manager
	m_pManager = new dgt_PluginManager();
	m_pManager->set_Path( wxEmptyString );
	m_pManager->set_CompPath( wxEmptyString );
	m_pManager->LoadAll();

	// Start application
	dgt_MainFrame *pFrame = new dgt_MainFrame( NULL );
	pFrame->Show();

    return true;
}

/*!
 * Cleanup for dgt_StudioApp
 */
int dgt_StudioApp::OnExit()
{    
////@begin dgt_StudioApp cleanup
    return wxApp::OnExit();
////@end dgt_StudioApp cleanup
}

